﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.Core;
using System.Windows.Forms;
using System.Reflection;
using System.Diagnostics;
using WareForms;
using Hydrobase;
using HydrobaseSDK;
using TheDarkOwlLogger;


namespace wow_backtiupCore
{
    /// <summary>
    /// Class that handles the external applications
    /// </summary>
   public   class ExternalRuningProcces
    {
       /// <summary>
       /// event handler that occures when an external application is closed
       /// </summary>
       /// <param name="sender"></param>
       /// <param name="ev"></param>
       public void prosexit(object sender, EventArgs ev)
       {

           try
           {

               Kernel.ExernalAppMenu.HideDropDown();
               Kernel.pros.Kill();

           }
           catch (Exception ex)
           {
               Program.Bugtracking(ex);

           }

       }
       /// <summary>
       /// Searches the process with the givan name 
       /// </summary>
       /// <param name="name">name of process</param>
       /// <returns>returns the process with the givan name </returns>
       public Process FindProcessByName(string name)
       {

           try
           {
               Process ret = null;
               if (name != null)
               {

                   ret = Process.GetProcessesByName(name)[0];

               }
               return ret;

           }
           catch (Exception ex)
           {
               Program.Bugtracking(ex);
               return null;



           }

       }
      
    }
}
